/**
 * 超级数组
 */
public class SuperArray {
    private Object [] ary = new Object[0];
    /**
     * 获取数组的长度
     * @return
     */
    public int size(){
        return this.ary.length;
    }

    /**
     * 获取数组中的指定元素
     * @param index
     * @return
     */
    public Object get(int index){
        return this.ary[index];
    }

    /**
     * 修改指定下标的元素
     * @param obj
     * @param index
     */
    public void set(Object obj,int index){

    }

    /**
     * 添加元素到数组的末尾
     * @param obj
     */
    public void add(Object obj){
        Object [] newAry = new Object[this.size() + 1];
        for(int i = 0;i < this.size();i++){
            newAry[i] = this.ary[i];
        }
        newAry[newAry.length - 1] = obj;
        this.ary = newAry;
    }

    /**
     * 添加元素到数组的指定位置
     * @param obj
     * @param index
     */
    public void add(Object obj,int index){

    }

    /**
     * 删除指定位置的元素
     * @param index
     */
    public void remove(int index){
        Object [] newAry = new Object[this.size() - 1];
        for(int i = 0;i < newAry.length;i++){
            if(i < index){
                newAry[i] = this.ary[i];
            }else{
                newAry[i] = this.ary[i+1];
            }
        }
        this.ary = newAry;
    }
}
